<?php

namespace app\service;

use app\popo\dto\OrdersCancelDTO;
use app\popo\dto\OrdersConfirmDTO;
use app\popo\dto\OrdersPageQueryDTO;
use app\popo\dto\OrdersPaymentDTO;
use app\popo\dto\OrdersRejectionDTO;
use app\popo\dto\OrdersSubmitDTO;
use app\popo\vo\OrderPaymentVO;
use app\popo\vo\OrderStatisticsVO;
use app\popo\vo\OrderSubmitVO;
use app\popo\vo\OrderVO;
use app\support\ListContainer;
use Webman\Http\Request;

interface OrderService
{
    public function conditionSearch(Request $request);
    
    /**
     * 用户下单
     * @param OrdersSubmitDTO $ordersSubmitDTO
     * @return OrderSubmitVO
     */
    public function submitOrder(OrdersSubmitDTO $ordersSubmitDTO): OrderSubmitVO;
    
    /**
     * 订单支付
     * @param OrdersPaymentDTO $ordersPaymentDTO
     * @return OrderPaymentVO
     */
    public function payment(OrdersPaymentDTO $ordersPaymentDTO): OrderPaymentVO;
    
    /**
     * 历史订单查询
     * @param int $page
     * @param int $pageSize
     * @param int|null $status
     * @return ListContainer
     */
    public function pageQuery4User(int $page, int $pageSize, ?int $status): ListContainer;
    
    /**
     * 查询订单详情
     * @param int $id
     * @return OrderVO
     */
    public function details(int $id): OrderVO;
    
    /**
     * 用户取消订单
     * @param int $id
     * @return void
     */
    public function userCancelById(int $id): void;
    
    /**
     * 再来一单
     * @param int $id
     * @return void
     */
    public function repetition(int $id): void;
    
    /**
     * 客户催单
     * @param int $id
     * @return void
     */
    public function reminder(int $id): void;
    
    /**
     * 管理端订单条件搜索
     * @param OrdersPageQueryDTO $ordersPageQueryDTO
     * @return ListContainer
     */
    public function conditionSearchAdmin(OrdersPageQueryDTO $ordersPageQueryDTO): ListContainer;
    
    /**
     * 各个状态的订单数量统计
     * @return OrderStatisticsVO
     */
    public function statistics(): OrderStatisticsVO;
    
    /**
     * 接单
     * @param OrdersConfirmDTO $ordersConfirmDTO
     * @return void
     */
    public function confirm(OrdersConfirmDTO $ordersConfirmDTO): void;
    
    /**
     * 拒单
     * @param OrdersRejectionDTO $ordersRejectionDTO
     * @return void
     */
    public function rejection(OrdersRejectionDTO $ordersRejectionDTO): void;
    
    /**
     * 取消订单
     * @param OrdersCancelDTO $ordersCancelDTO
     * @return void
     */
    public function cancel(OrdersCancelDTO $ordersCancelDTO): void;
    
    /**
     * 派送订单
     * @param int $id
     * @return void
     */
    public function delivery(int $id): void;
    
    /**
     * 完成订单
     * @param int $id
     * @return void
     */
    public function complete(int $id): void;
}